﻿
////////////////////////////////////////////////////////////////////////////////////////////
// 文件名: ETL_Source_View_ColumnConfigBLL.gen.cs
//
// 模块名称: ETLSourceViewColumnBll
//
// 作者: LPC
//
// 历史记录（记录修改记录，修改文件后请添加修改记录，注明修改时间、修改人，修改内容）:
// 13-2-6    LPC    创建文件
////////////////////////////////////////////////////////////////////////////////////////////

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Common;
using DAL;
using Model;

namespace BLL
{
    /// <summary>
    /// ETL_Source_View_ColumnConfig表业务逻辑层
    /// </summary>
    public class EtlSourceViewColumnConfigBLL : BaseBLL
    {
        public EtlSourceViewColumnConfigBLL(LoginInfo info)
        {
            loginInfo = info;
        }
        const string ErrorCodeSelect = "";    //查询异常编码
        const string ErrorCodeInsert = "";    //添加异常编码
        const string ErrorCodeUpdate = "";    //修改异常编码
        const string ErrorCodeDelete = "";    //删除异常编码

        //public ETL_Source_View_ColumnConfigBLL(IUserInfo user) : base(user)
        //{
        //}
        /// <summary>
        /// 创建BLL对象
        /// </summary>
        /// <summary>
        /// 根据GUID字段获取ETL_Source_View_ColumnConfigInfo实体对象
        /// </summary>
        /// <param name="guid">GUID</param>
        /// <returns>ETL_Source_View_ColumnConfigInfo实体对象</returns>
        public ETL_Source_View_ColumnConfigInfo GetInfoById(string guid)
        {
            try
            {
                EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
                return dal.GetInfoById(guid);
            }
            catch (Exception ex)
            {
                Logger.LogError("ETL_Source_View_ColumnConfigBLL", "GetInfo", AppError.EROR, 0, ex, "获取ETLSourceViewColumnBll信息出错。",
                                String.Format("guid = {0}", guid));
                throw new SystemException(ErrorCodeSelect, ex);
            }
        }

        /// <summary>
        /// 往ETL_Source_View_ColumnConfig表内添加新记录
        /// </summary>
        /// <returns>添加记录索引值</returns>
        public int Insert(IDataParameter[] par)
        {
            try
            {
                EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
                int identity = dal.Insert(par);
                return identity;
            }
            catch (Exception ex)
            {
                Logger.LogError("ETL_Source_View_ColumnConfigBLL", "Insert", AppError.EROR, 0, ex, "添加ETLSourceViewColumnBll信息出错。", null);
                throw new SystemException(ErrorCodeInsert, ex);
            }
        }

        /// <summary>
        /// 更新ETL_Source_View_ColumnConfig表记录
        /// </summary>
        public void Update(ETL_Source_View_ColumnConfigInfo eTLSourceViewColumnConfigInfo)
        {
            try
            {
                EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
                dal.Update(eTLSourceViewColumnConfigInfo);
            }
            catch (Exception ex)
            {
                Logger.LogError("ETL_Source_View_ColumnConfigBLL", "Update", AppError.EROR, 0, ex, "更新ETLSourceViewColumnBll信息出错。",
                                String.Format("GUID = {0}", eTLSourceViewColumnConfigInfo.Guid));
                throw new SystemException(ErrorCodeUpdate, ex);
            }
        }

        /// <summary>
        /// 根据GUID字段获取ETL_Source_View_ColumnConfigInfo实体对象
        /// </summary>
        /// <param name="guid">GUID</param>
        public void DeleteViewCol(SqlParameter[] guid)
        {
            try
            {
                EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
                dal.DeleteViewCol(guid);
            }
            catch (Exception ex)
            {
                Logger.LogError("ETL_Source_View_ColumnConfigBLL", "Delete", AppError.EROR, 0, ex, "删除ETLSourceViewColumnBll信息出错。",
                                String.Format("guid = {0}", guid));
                throw new SystemException(ErrorCodeDelete, ex);
            }
        }


        /// <summary>
        /// 根据GUID字段获取ETL_Source_View_ColumnConfigInfo实体对象
        /// </summary>
        /// <returns>List<ETL_Source_View_ColumnConfigInfo/>实体对象</returns>
        public List<ETL_Source_View_ColumnConfigInfo> GetList(IDataParameter[] par)
        {
            try
            {
                EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
                return dal.GetList(par);
            }
            catch (Exception ex)
            {
                Logger.LogError("ETL_Source_View_ColumnConfigBLL", "GetInfo", AppError.EROR, 0, ex, "获取ETLSourceViewColumnBll信息出错。",
                                "");
                throw new SystemException(ErrorCodeSelect, ex);
            }
        }

        /// <summary>
        /// 根据GUID字段获取ETL_Source_View_ColumnConfigInfo实体对象
        /// </summary>
        /// <returns>List<ETL_Source_View_ColumnConfigInfo/>实体对象</returns>
        public int GetListCount(IDataParameter[] par)
        {
            try
            {
                EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
                return dal.GetListCount(par);
            }
            catch (Exception ex)
            {
                Logger.LogError("ETL_Source_View_ColumnConfigBLL", "GetInfo", AppError.EROR, 0, ex, "获取ETLSourceViewColumnBll信息出错。",
                                "");
                throw new SystemException(ErrorCodeSelect, ex);
            }
        }

        public void CreateTable(SqlParameter[] paraTable)
        {
            try
            {
                EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
                dal.CreateTable(paraTable);
            }
            catch (Exception ex)
            {
                Logger.LogError("ETL_Source_View_ColumnConfigBLL", "GetInfo", AppError.EROR, 0, ex, "获取ETLSourceViewColumnBll信息出错。",
                                "");
                throw new SystemException(ErrorCodeSelect, ex);
            }
        }

        public List<ETL_Source_View_ColumnConfigInfo> GetViewColumnById(SqlParameter[] par)
        {
            try
            {
                EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
                return dal.GetViewColumnById(par);
            }
            catch (Exception ex)
            {
                Logger.LogError("ETL_Source_View_ColumnConfigBLL", "GetInfo", AppError.EROR, 0, ex, "获取ETLSourceViewColumnBll信息出错。",
                                "");
                throw new SystemException(ErrorCodeSelect, ex);
            }
        }

        public List<ETL_Source_View_ColumnConfigInfo> GetColumnInfoByOutSystem(SqlParameter[] columnPar, string connstr, string connType, string tbOwer)
        {
            try
            {
                EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
                return dal.GetColumnInfoByOutSystem(columnPar, connstr, connType, tbOwer);
            }
            catch (Exception ex)
            {
                Logger.LogError("ETL_Source_View_ColumnConfigBLL", "GetInfo", AppError.EROR, 0, ex, "获取ETLSourceViewColumnBll信息出错。",
                                "");
                throw new SystemException(ErrorCodeSelect, ex);
            }
        }

        #region ETL_Source_View_ColumnConfig

        public List<ETL_Source_View_ColumnConfigInfo> GetSourceViewColumnConfigByViewID(string viewID)
        {
            EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
            return dal.GetSourceViewColumnConfigByViewID(viewID);
        }

        public int DeleteSourceViewColumnConfigByViewID(string columnID)
        {
            EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
            return dal.DeleteSourceViewColumnConfigByViewID(columnID);
        }

        public int InsertSourceViewColumnConfig(ETL_Source_View_ColumnConfigInfo sourceViewColumnInfo)
        {
            EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
            return dal.InsertSourceViewColumnConfig(sourceViewColumnInfo);
        }
        public int UpdateSourceViewColumnConfig(ETL_Source_View_ColumnConfigInfo sourceViewColumnInfo)
        {
            EtlSourceViewColumnConfigDAL dal = new EtlSourceViewColumnConfigDAL(loginInfo);
            return dal.UpdateSourceViewColumnConfig(sourceViewColumnInfo);
        }
        #endregion

 
    }
}